//
//  UIView+Rect.m
//  doubanFun
//
//  Created by bing on 16/3/25.
//  Copyright © 2016年 bing. All rights reserved.
//

#import "UIView+Rect.h"

@implementation UIView (Rect)

- (CGFloat)top {
    return self.frame.origin.x;
}

- (void)setTop:(CGFloat)top {
    CGRect rect = self.frame;
    rect.origin.x = top;
    self.frame = rect;
}

- (CGFloat)left {
    return self.frame.origin.y;
}

- (void)setLeft:(CGFloat)left {
    CGRect rect = self.frame;
    rect.origin.y = left;
    self.frame = rect;
}

- (CGFloat)width {
    return self.frame.size.width;
}

- (void)setWidth:(CGFloat)width {
    CGRect rect = self.frame;
    rect.size.width = width;
    self.frame = rect;
}

- (CGFloat)height {
    return self.frame.size.height;
}

- (void)setHeight:(CGFloat)height {
    CGRect rect = self.frame;
    rect.size.height = height;
    self.frame = rect;
}
@end
